export const gameList = [
	{
		id: 1,
		name: '先负带后富',
		hot: 4736,
		cover: '/static/game/rich/cover.jpeg',
		coverWidth: 864,
		coverHeight: 1152,
		page: '/pages/game/rich/index',
		des: '初学师范，未能从业，后贩电视，遇下周回国，遂共享经济，押金不退，再投身地产，有所成就，终挑一良盘，却没能封顶……'
	}
]

// 逐字打印文字
export function verbatimText(text, onProgress, onComplete) {
	let index = 1
	let timeInterval = setInterval(timePrint, 100)
	
	function timePrint() {
		let currentText = text.slice(0, index)
		if(index >= text.length) {
			onComplete && onComplete(currentText)
			clearInterval(timeInterval)
			timeInterval = null
		} else {
			onProgress && onProgress(currentText)
			index += 1
		}
	}
	
	return {
		finish: () => {
			onComplete && onComplete(text)
			clearInterval(timeInterval)
			timeInterval = null
		}
	}
}